package com.reebake.ideal.message.websocket.core;

import com.reebake.ideal.message.websocket.entity.WebsocketMessageTransferDTO;
import org.springframework.data.redis.core.RedisTemplate;


import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class RedisWebsocketMessagePublisher implements WebsocketMessagePublisher {

    private final RedisTemplate<String, Object> redisTemplate;
    private final String websocketTopic;
 
    @Override
    public void sendMessage(WebsocketMessageTransferDTO message) {
        redisTemplate.convertAndSend(websocketTopic, message);
    }
    
}
